package string;

public class ValueOfDemo {
    public static void main(String[] args) {
        int a=123;
        String s1 =String.valueOf(a);//将int变量a转为字符串类型，并赋值s1
        System.out.println(s1);

        double b=123.456;
        String s2 =String.valueOf(b);
        System.out.println(s2);

        String s3 =b+"";//任何类型与字符串相连结果都会变成字符串类型，效率低
        System.out.println("s3");

    }
}
